package cl.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.Scanner;

public class FileUtil {
    
    public static StringBuilder read(File file) throws FileNotFoundException {
        StringBuilder str = new StringBuilder();
        
        Scanner scanner = new Scanner(new FileReader(file));
        
        try {
            while (scanner.hasNextLine()) {
                str.append(scanner.nextLine());
                str.append(System.getProperty("line.separator"));
            }
        } finally {
            scanner.close();
        }
        
        return str;
    }
    
}
